use axum::{extract::State, Json};
use std::sync::Arc;
use sea_orm::query::*;

use com::{code, wss::state::AppState};

pub async fn test(State(state): State<Arc<AppState>>) -> Result<Json<JsonValue>, Json<JsonValue>>{
    match state.tx.send("成功".to_owned()) {
        Ok(_) => code::ok(),
        Err(e) => code::sys(e.to_string())
    }
}